<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:composition>
        <h:form style="text-align: center; font-size: 90%;" id="topForm" >
            <f:view locale="#{locale.locale}" >
                <p:panelGrid columns="1" styleClass="v_top_tb" >

                    <p:row>
                        <div style="float: left; ">
                            <h:outputText value="  #{schoolmat.mat.subject.name} " style="font-size: 130%; font-weight: bold;" />
                            <h:outputText value=" - #{schoolmat.mat.name}, #{schoolmat.mat.week}. #{trans.week}" style="font-size: 115%;"/>
                            <h:outputText value="    #{trans.lastChange}: #{schoolmat.mat.lastChange}" style="font-size: 90%; margin-left: 10px;" >
                                <f:convertDateTime type="date" pattern="dd.MM.yyyy"/>
                            </h:outputText>
                        </div>

                        <div style="float: right;">
                            <p:commandButton value="#{trans.yourComments}" onclick="dlg5.show()"/>
                            <p:commandButton onclick="window.close()" title="#{trans.close}" icon="ui-icon-closethick" style="margin-left: 5px;"/>
                        </div>
                    </p:row>
                    <p:row>
                        <div style="float: left;">
                            <p:commandButton title="#{trans.nextPage}" icon="ui-icon-circle-triangle-s" actionListener="#{viewer.nextPage()}" update=":imageForm, topForm" >
                            </p:commandButton>
                            <p:commandButton title="#{trans.prevPage}" icon="ui-icon-circle-triangle-n" actionListener="#{viewer.previousPage()}" update=":imageForm, topForm">
                            </p:commandButton>

                            <p:spinner id="spinnerBasic" value="#{viewer.actualPage}" size="3" style="margin-left: 10px; margin-right: 40px;" title="#{trans.choosePage}" max="#{reader.totalPages}" min="1">

                            </p:spinner>


                            <p:commandButton title="#{trans.zoomOut}" icon="ui-icon-circle-minus" actionListener="#{viewer.zoomOut()}" update=":imageForm, topForm"/>
                            <h:inputText value="#{viewer.zoomInPercent}%" readonly="true" size="4" style="height: 18px; position: relative; top: 1px;" disabled="true"/>
                            <p:commandButton title="#{trans.zoomIn}" icon="ui-icon-circle-plus" actionListener="#{viewer.zoomIn()}" update=":imageForm, topForm"/>

                            <p:commandButton title="#{trans.restoreWindow}" icon="ui-icon-arrowrefresh-1-e" style="margin-left: 40px;" actionListener="#{viewer.restoreZoom()}" update=":imageForm, topForm"/>
                            <p:commandButton title="#{trans.fitToWindow}" icon="ui-icon-arrowthick-2-ne-sw" actionListener="#{viewer.fitToWindow()}" update=":imageForm, topForm"/>
                            <p:commandButton title="#{trans.fullscreen}" icon="ui-icon-arrow-4-diag"/>


                            <p:commandButton title="#{trans.turnOnNotes}" actionListener="#{viewer.turnOnNotes()}"
                                             value="#{trans.turnOnNotes}" style="margin-left: 150px;" onclick="dlg.show();" 
                                             rendered="#{!viewer.activeComments}" update="topForm" />

                            <p:commandButton title="#{trans.turnOffNotes}" actionListener="#{viewer.turnOffNotes()}" 
                                             value="#{trans.turnOffNotes}" style="margin-left: 150px;" onclick="dlg.close();" 
                                             rendered="#{viewer.activeComments}" update="topForm"/>

                        </div>

                        <div style="float: right;">
                            <h:outputText value="    V dokumentu je celkem #{schoolmat.mat.notes} poznamek" style="font-size: 90%; margin-right: 10px;" />


                            <p:menuButton value="#{trans.settings}" style=" margin-right: 18px;">  
                                <p:menuitem value="#{trans.b_skin}"  onclick="dlg3.show();"/>  
                                <p:menuitem value="#{trans.b_language}" onclick="dlg4.show();"/>  

                            </p:menuButton>  

                            <p:commandButton title="#{trans.rate}" icon="ui-icon-star" onclick="dlg2.show();"/>
                            <p:commandButton title="#{trans.b_help}" icon="ui-icon-help"/>
                        </div>
                    </p:row>



                </p:panelGrid>

            </f:view>
            
            
        </h:form>
        
         

        <p:dialog id="modalDialog2" header="#{trans.viewerTools}" widgetVar="dlg" 
                  appendToBody="true" position="210, 95" closable="false" 
                  style="z-index: 999 !important;" resizable="false" width="140" visible="#{viewer.activeComments}">  
            <h:form>
                <h:commandButton  action="#{viewer.activeSelectTool()}" styleClass="#{viewer.styleButton(0)}" 
                                  image="resources/images/i_selectTool.png" title="#{trans.b_selectTool}">
                    <f:ajax disabled="true" />
                </h:commandButton>
                <h:commandButton action="#{viewer.activePinTool()}" styleClass="#{viewer.styleButton(1)}" 
                                 image="resources/images/i_pinTool.png" title="#{trans.b_pinTool}">
                    <f:ajax disabled="true" />
                </h:commandButton>
                <h:commandButton action="#{viewer.activeAreaTool()}" styleClass="#{viewer.styleButton(2)}" 
                                 image="resources/images/i_areaTool.png" title="#{trans.b_areaTool}" >
                    <f:ajax disabled="true" />
                </h:commandButton>
            </h:form>


        </p:dialog> 


        <p:dialog id="modalDialog3" header="#{trans.rate}" widgetVar="dlg2" 
                  appendToBody="true"  style="z-index: 999 !important;" >  

            <h:outputLabel value="Hodnocení dokumentu" ></h:outputLabel> <br />
            <p:rating value="#{schoolmat.mat.intRating()}"  />

        </p:dialog> 

        <p:dialog id="modalDialog4" header="#{trans.b_skin}" widgetVar="dlg3" 
                  appendToBody="true"  style="z-index: 999 !important;" >  

            <h:outputLabel value="#{trans.b_skin}" ></h:outputLabel> <br />
            <h:form> 
                <p:themeSwitcher style="width:155px; margin-top: 5px;" value="#{theme.theme}" effect="fade" >  
                    <f:selectItem itemLabel="#{trans.b_skin}"  itemValue="" />
                    <f:selectItems value="#{theme.themes}" />
                    <p:ajax listener="#{theme.saveTheme}" />
                </p:themeSwitcher>
            </h:form>

        </p:dialog>

        <p:dialog id="modalDialog5" header="#{trans.yourComments}" widgetVar="dlg4" 
                  appendToBody="true"  style="z-index: 999 !important;" >  

            <h:outputLabel value="#{trans.b_language}" ></h:outputLabel> <br />
            <h:form id="lang2" style="padding-top: 9px;">
                <h:commandLink action="#{locale.changeLanguage('cs')}" value="Čeština" immediate="true" />
                <h:outputLabel value=" | " />
                <h:commandLink action="#{locale.changeLanguage('en')}" value="English" immediate="true" />

            </h:form>


        </p:dialog>
        
        <p:dialog id="modalDialog6" header="#{trans.yourComments}" widgetVar="dlg5" 
                  appendToBody="true"  style="z-index: 999 !important;" >  

            <h:outputFormat value="Lorem ipsum" />


        </p:dialog>

    </ui:composition>




</html>

